package cate.common.table.activity.specall.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import org.apache.commons.lang3.StringUtils;

public class SpeCallBaseRow extends ERow {
    public int configId;

    public int type;

    public int callTimes;

    public int freeTimes;

    public String m1ConsumeStr;

    public int m1CallTimes;

    public int ensureUpTimes;

    public double addUpWeight;

    public String upRewardStr;

    public String consumeStr;

    public int group;

    public int whiteGroup;

    public int rareLimit;

    public String extraRewardStr;

    public int lampId;

    public String actName;

    public int rewardExp;

    private String cheatStr;

    @Override
    public void parse(XSSFRowWrap xrw) {
        this.id = xrw.getInteger("ID");
        this.configId = xrw.getInteger("配置ID");
        this.type = xrw.getInteger("类型");
        this.callTimes = xrw.getInteger("召唤次数");
        this.freeTimes = xrw.getInteger("免费次数");
        this.m1ConsumeStr = xrw.getString("碎钻召唤");
        this.m1CallTimes = xrw.getInteger("今日碎钻上限次数", 0);
        this.ensureUpTimes = xrw.getInteger("总幸运值");
        this.addUpWeight = xrw.getDouble("幸运值增加权重");
        this.upRewardStr = xrw.getString("幸运值奖励");
        this.consumeStr = xrw.getString("召唤道具");
        this.group = xrw.getInteger("卡池分组");
        this.whiteGroup = xrw.getInteger("白脸卡池分组");
        this.rewardExp = xrw.getInteger("奖励召唤经验", 0);
        this.rareLimit = xrw.getInteger("稀有道具次数上限", 0);
        this.extraRewardStr = xrw.getString("奖励兑换道具");
        this.lampId = xrw.getInteger("跑马灯", 0);
        this.actName = xrw.getString("活动名称");
        this.cheatStr = xrw.getString("作弊次数");
    }

    public int notCallTimes;
    public int mustCallTimes;

    @Override
    public void decode(){
        if (StringUtils.isNotBlank(cheatStr)) {
            String[] args = cheatStr.split("\\|");
            notCallTimes = Integer.parseInt(args[0]);
            mustCallTimes = Integer.parseInt(args[1]);
        }
    }
}
